﻿<admintpl file="header" />
</head>
<body class="J_scroll_fixed">
	<div class="wrap js-check-wrap">
		<ul class="nav nav-tabs">
			<li class="active"><a href="{:U('Cdkey/giftlist')}">激活码列表</a></li>
			<li><a href="{:U('Cdkey/add')}" target="_self">添加激活码</a></li>
		</ul>

		<form class="well form-search" method="post" action="{:U('Cdkey/giftlist')}">
			<div class="search_type cc mb10">
				<div class="mb10">
					<span class="mr20">
					    激活码名： 
						<input type="text" name="title" style="width: 200px;" value="{$title}" placeholder="请输入激活码名...">
						&nbsp;&nbsp;
						游戏： 
						<select class="select_2" name="appid" id="selected_id">
							<foreach name="games"  key="k" item="vo">
								<php>$g_select=$k==$appid ?"selected":"";</php>
								<option value="{$k}"{$g_select}>{$vo}</option>
							</foreach>
						</select>						
						&nbsp;&nbsp;
						<input type="submit" class="btn btn-primary" value="搜索" />
					</span>
				</div>
			</div>
		</form>
		<form class="js-ajax-form" action="" method="post">
			<table class="table table-hover table-bordered table-list">
				<thead>
					<tr>
						<th>创建时间</th>
						<th>激活码名</th>
						<th>游戏名</th>
						<th>兑换开始时间</th>
						<th>兑换结束时间</th>
						<th>剩余数量/总数</th>
						<th width="150">管理操作</th>
					</tr>
				</thead>
			
				<foreach name="giftlist" item="vo">
				<tr>
					<td>{:date('Y年m月d日  H:i',$vo['create_time'])}</td>
					<td>{$vo.title}</td>
					<td>{$games[$vo['app_id']]}</td>
					<td>{:date('Y年m月d日  H:i',$vo['start_time'])}</td>
					<td>{:date('Y年m月d日  H:i',$vo['end_time'])}</td>
					<td>{$vo.remain}/{$vo.total}</td>
					<td>
					    <a href="{:U('Cdkey/edit',array('id'=>$vo['id']))}">修改</a> 
						<a href="{:U('Cdkey/del',array('id'=>$vo['id']))}" class="js-ajax-delete">删除</a></td>
				</tr>
				</foreach>
			</table>
			<div class="pagination">{$Page}</div>
		</form>
	</div>
	<script src="__PUBLIC__/js/common.js"></script>
	<script>
		$(function() {
			$("#navcid_select").change(function() {
				$("#mainform").submit();
			});

		});
	</script>
</body>
</html>